package com.example.dataservice.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.api.model.Image;


public interface ImageMapper {

    @Insert("""
            insert into u_image
            values(null,#{uid},#{path})
            """)
    /*新增*/
    int insertImage(Image image);

    @Update("""
            update u_image
            set path = #{path}
            where uid = #{uid}
            """)
    /*更新*/
    int updateImage(Image image);

    @Select("""
            select * from u_image
            where uid = #{uid}
            """)
    /*根据uid查询*/
    Image selectImageByUid(Image image);

}
